package com.yyhh.helpcall.http.api;

import com.yyhh.helpcall.base.RecordConfig;
import com.yyhh.helpcall.http.bean.BaseResponse;
import com.yyhh.helpcall.http.bean.CallLogResponse;
import com.yyhh.helpcall.http.bean.CustomResponse;
import com.yyhh.helpcall.http.bean.LastUpdateResponse;
import com.yyhh.helpcall.http.bean.LoginResponse;
import com.yyhh.helpcall.http.bean.TellInfosRsponse;

import java.util.ArrayList;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface Api {

    @GET("Call/Login/login")
    Observable<BaseResponse<LoginResponse>> login(@Query("business_tel") String phone, @Query("passwd") String pass);

    @FormUrlEncoded
    @POST("Call/Call/phone_type")
    Observable<BaseResponse<ArrayList<RecordConfig>>> getRecordConfig(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("Call/Call/getTelInfos")
    Observable<BaseResponse<TellInfosRsponse>> getTellInfos(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("Call/Call/bindclient")
    Observable<BaseResponse<Object>> bindClient(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("Call/Call/CallRecord")
    Observable<BaseResponse<Object>> postCallLogs(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("Call/Call/getCusDetail")
    Observable<BaseResponse<CustomResponse>> getCustomerDetail(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("Call/Call/VoiceFileName")
    Observable<BaseResponse<Object>> postCallRecord(@FieldMap Map<String, String> map);

    @POST("Call/Call/oss_upload")
    Observable<BaseResponse<Object>> uploadFile(@Body MultipartBody body);

    @FormUrlEncoded
    @POST("Call/Call/GetLastUpload")
    Observable<BaseResponse<LastUpdateResponse>> getLastCallLogsTime(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("Call/Call/GetLastVoiceTime")
    Observable<BaseResponse<LastUpdateResponse>> getLastRecordTime(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("Call/Call/voiceMonitorList")
    Observable<BaseResponse<CallLogResponse>> getRecordList(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("Call/Call/telMonitorList")
    Observable<BaseResponse<CallLogResponse>> getCallList(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("Call/Call/saveHuaweiToken")
    Observable<BaseResponse<CallLogResponse>> bindHuaWeiToken(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("Call/Call/addcallLog")
    Observable<BaseResponse<CallLogResponse>> addcallLog(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("Call/Call/phone_dir")
    Observable<BaseResponse<ArrayList<String>>> phoneDirs(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("Call/Call/up_phone_dir")
    Observable<BaseResponse<Object>> upPhoneDir(@FieldMap Map<String, String> map);
}
